/* $Id: SearchEngine.java,v 1.2 2003/08/02 20:57:54 survey Exp $
 * 
 *                 Sun Public License Notice
 * 
 * The contents of this file are subject to the Sun Public License
 * Version 1.0 (the "License"). You may not use this file except in
 * compliance with the License. A copy of the License is available at
 * http://www.sun.com/
 * 
 * The Original Code is NetBeans. The Initial Developer of the Original
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun
 * Microsystems, Inc. All Rights Reserved.
 */

package org.medbeans.modules.search;


import org.openide.nodes.Node;
/*import org.openide.nodes.NodeAcceptor;
import org.openide.util.Task;*/
import org.openidex.search.SearchGroup;


/**
 * Search engine. Spawns search task thread.
 *
 * @author  Petr Kuzel, Peter Zavadsky
 */
public class SearchEngine {

    /** Creates search task and executes it in new thread.
     * @return <code>Task</code> can be tested on end using addTaskListener(). */
    public SearchTask search(Node[] nodes, SearchGroup searchGroup, ResultModel resultModel) {
        SearchTask task = new SearchTask(nodes, searchGroup, resultModel);

        Thread searchThread = new Thread(task, "SearchTask"); // NOI18N

        searchThread.setDaemon(true);
        searchThread.start();

        return task;
    }

}
